package com.example.service;


import com.example.entity.CommonReqDTO;
import com.example.mapper.ComponentTemplateInstMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Transactional
@Service
public class HealthServiceImpl implements HealthService{

    @Autowired
    private ComponentTemplateInstMapper componentTemplateInstMapper;

    @Autowired
    private DataService dataServcie;

    @Override
    public List<Map<String, Object>> getConfigData(Long instId, CommonReqDTO reqDTO) {
        if(instId == null) throw new IllegalArgumentException("实例id为空");

        String testSql = "SELECT  id, name ,age,start_time,end_time from test";

        Map<String, Object> map = new HashMap<>();
        map.put("sql", testSql);
        map.put("reqDTO",reqDTO);

        List<Map<String, Object>> data3 = dataServcie.getData(map);
        return data3;
    }
}
